package com.newer.his.common.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.One;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import com.newer.his.common.entity.Dept;
import com.newer.his.common.entity.Doctor;
import com.newer.his.common.entity.DoctorDept;

@Mapper
public interface DoctordeptMapper {
	
	
	
	
	@Results(id = "",
			value = {
					@Result( property = "id" ,column = "doctor_dept_id"),
					@Result( property = "doctorid",column = "id_doctor",
							javaType = Doctor.class,		
							one = @One(select="com.newer.his.common.mapper.DoctorMapper.findById")),
					
					@Result( property = "deptid",column = "id_dept",
					javaType =Dept.class,
					one = @One(select="com.newer.his.common.mapper.DeptMapper.findbyId")),
					}
			)
	@Select("select doctor_dept_id,id_doctor,id_dept from doctor_dept;")
	
	 List<DoctorDept> getall();

}
